package com.ggs.rg.ybjb.adminmodule;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication
@MapperScan("com.ggs.rg.ybjb.adminmodule.mapper")
@EnableTransactionManagement
public class AdminModuleApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(AdminModuleApplication.class, args);
    }

    /*
     *  配置外部tommcat
     */
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        // 注意这里要指向原先用main方法执行的Application启动类
        return application.sources(AdminModuleApplication.class);
    }
}
